<!-- 预警信息   -->
<script>

 import { trackPageAlarmPerson } from "@/api/pageStats"

  export default {
    data() {
      return {
        tableLoading_warger:false,
        tableData_warger: [],
        form:{},
        pageObj: {
          total: 11,
          currentPage: 0,
          pageSize: 10,
          pageSizes: [10, 20, 30]
        },
        typeRYLB:{
          'ZJ': "评标专家",
          'JD': "甲方代表",
          'ZBDL': "招标代理",
        },
        // show:true,
      };
    },
    methods:{
      // 
     async gtTrackListAlarm(data){
      console.log(data);
      const { projectName,projectId,projectCode,bidName,bidCode,bidId} = data
      this.form = { projectName,projectId,projectCode,bidName,bidCode,bidId}
      if(!bidId) return 
      const p=  {
          bidId,
          currentPage: this.pageObj.currentPage,
          pageSize:this.pageObj.pageSize
          }
      const r = await trackPageAlarmPerson(p)
        if(r.code === 0){
          this.tableData_warger = r.data.data
          this.pageObj.total = r.data.pageBean.count

        }else{
          this.$message.error(r.msg)
        }
      },
      subtaskListFn(){},
    
      formatterTypeRYLB(row, col, val){
        let str = ''
        if(val){
          str = this.typeRYLB[val]
        }
        return str
      },
      enterClickFn(data){
        this.$router.push({path:'/wintessquery/wangerDetail',query:data})
      }
    }
  };
</script>
<template>
  <el-dialog
    width="60%"
    
    :close-on-click-modal="false"
    draggable
    :show-close="true"
    title="预警事件"
    v-bind="$attrs"
    :before-close="() => $emit('update:visible', false)"
  >
    <div class="flex"> <div  class="ui-title"> 项目名称:{{ form.projectName }}</div><div>项目编码:{{ form.projectCode}}</div></div>
    <div class="flex"> <div  class="ui-title"> 标段名称:{{ form.bidName }}</div><div>标段编码:{{ form.bidCode }}</div></div>
    <div>
      <el-table ref="taskTable" v-loading="tableLoading_warger" :data="tableData_warger" stripe>
        <el-table-column type="index" align="center" label="序号" width="50">
          <template slot-scope="scope">
            {{ pageObj.currentPage * pageObj.pageSize + 1 + scope.$index }}
          </template>
        </el-table-column>
        <el-table-column prop="personName" label="人员姓名" show-overflow-tooltip />
        <el-table-column prop="personType" label="人员类型"   :formatter="formatterTypeRYLB" />
        <el-table-column prop="alarmTime" label="警告时间" width="180" />
        <el-table-column prop="duration" label="时长"  show-overflow-tooltip />
        <el-table-column prop="alarmName" label="预警类型" show-overflow-tooltip />
        <el-table-column label="操作" align="center" header-align="center" width="150">
          <template slot-scope="scope">
            <el-button type="text" size="default" @click="enterClickFn(scope.row)">预警详情</el-button>
            <!-- <el-button type="text" size="default" @click="allocateUserClickFn(scope.row)">轨迹查询</el-button> -->
          </template>
        </el-table-column>
      </el-table>
      <wpagination
        style="text-align: right"
        v-if="pageObj.total > pageObj.pageSizes[0]"
        :total="pageObj.total"
        :page.sync="pageObj.currentPage"
        :limit.sync="pageObj.pageSize"
        :page-sizes="pageObj.pageSizes"
        @pagination="subtaskListFn"
      />
    </div>
    <!--          <span slot="footer" class="dialog-footer">-->
    <!--            <el-button :loading="btnLoading" type="primary" @click="yjzzData('yjzzForm')">-->
    <!--              确定-->
    <!--            </el-button>-->
    <!--            <el-button @click="cancel('yjzzForm')">取消</el-button>-->
    <!--          </span>-->
  </el-dialog>
</template>
<style scoped lang="scss">
.flex{
  display: flex;
  align-items: center;
  & >div:first-child{
    min-width: 400px;
  }
}
</style>
